/**
 * 添加日期范围
 * @param params
 * @param dateRange
 * @returns
 */
export function addDateRange(params: any, dateRange: string[]) {
  const search = params;
  search.params =
    typeof search.params === 'object' &&
    search.params !== null &&
    !Array.isArray(search.params)
      ? search.params
      : {};
  dateRange = Array.isArray(dateRange) ? dateRange : [];
  search.params.beginTime = dateRange[0];
  search.params.endTime = dateRange[1];
  return search;
}
